package com.bw.medical.service.impl;

import com.bw.medical.vo.HospitalVo;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bw.common.utils.PageUtils;
import com.bw.common.utils.Query;

import com.bw.medical.dao.TbHospitalDao;
import com.bw.medical.entity.TbHospitalEntity;
import com.bw.medical.service.TbHospitalService;


@Service("tbHospitalService")
public class TbHospitalServiceImpl extends ServiceImpl<TbHospitalDao, TbHospitalEntity> implements TbHospitalService {

    @Override
    public PageUtils queryPage(Map<String, Object> params,String hospitalName) {
        QueryWrapper<TbHospitalEntity> wrapper = new QueryWrapper<>();
            if (hospitalName!=null&& !hospitalName.equals("")){
                wrapper.like("hospital_name",hospitalName);
            }
        IPage<TbHospitalEntity> page = this.page(
                new Query<TbHospitalEntity>().getPage(params),
                wrapper
        );

        return new PageUtils(page);
    }

}